<?php
// +----------------------------------------------------------------------
// | WoShiMaiJia Projcet 
// +----------------------------------------------------------------------
// | Copyright (c) 2010-2011 http://woshimaijia.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: xinqiyang <xinqiyang@gmail.com>
// +----------------------------------------------------------------------

/**
 * return all of the sys forms 
 */
return array(
	'WebForms'=>array(
		'signup'=>array(
			'object'=>'account',
			'fields'=>array('id'=>'id','account'=>'account','password'=>'password','email'=>'email','ip'=>'ip'),
			'method'=>'post', // define method post/get
			'api'=>'AccountLogic::actSignUp', //get the api logic do deal the request
			'ajax'=>'0', // set 1/0 
			//POST data check
			'check'=>array(
				//checktype 1=>must_validate,2=>value_validate,3=>exist_validate
				//'account'=>array(1,'require','标题必须填写'),//validate preg check, error report
				'email'=>array(2,'email','邮箱格式错误'),
				'account'=>array(2,'require','显示名错误'),
			),
			'auto'=>array(
				'id'=>'objid',
				'password'=>'md5',
				'createtime'=>'time',
				'ip'=>'getip',
			),
			
			'callback'=>'account',
			'next'=>'account/setting', //add form to deal
			'return'=>'json', //return json/xml
		),
		
		'tweet'=>array(
			'object'=>'post',
			'fields'=>array('id'=>'id','content'=>'content','object'=>'object','user_id'=>'user_id','createtime'=>'createtime'),
			'method'=>'post', // define method post/get
			'api'=>'PostLogic::addPost', //get the api logic do deal the request
			'ajax'=>'0', // set 1/0 
			//POST data check
			'check'=>array(
				//check conent
				'content'=>array(2,'require','不能为空'), //use the func return result
			),
			'auto'=>array(
				'id'=>'objid',
				'user_id'=>'userid',
				'createtime'=>'time',
			),
			//set the default value of the form
			'value'=>array(
				'object'=>'say',
			),
			'next'=>'index/home', //add form to deal
			'return'=>'json', //return json/xml
		),
		
		'comment'=>array(
			'object'=>'post',
			'fields'=>array('id'=>'id','content'=>'content','topic_id'=>'topic_id','object'=>'object','user_id'=>'user_id','createtime'=>'createtime'),
			'method'=>'post', // define method post/get
			'api'=>'PostLogic::addPost', //get the api logic do deal the request
			'ajax'=>'0', // set 1/0 
			//POST data check
			'check'=>array(
				//check conent
				//@TODO 这里的TOPIC_id 
				'topic_id'=>array(2,'require','ID不能为空'), //use the func return result
				'content'=>array(2,'require','不能为空'), //use the func return result
			),
			'auto'=>array(
				'id'=>'objid',
				'user_id'=>'userid',
				'createtime'=>'time',
			),
			//set the default value of the form
			'value'=>array(
				'object'=>'comment',
			),
			'next'=>'index/home', //add form to deal
			'return'=>'json', //return json/xml
		),
		
		
		'url'=>array(
			'object'=>'url',
			'fields'=>array('id'=>'id','title'=>'title','tags'=>'tags','desc'=>'desc','image'=>'image','status'=>'status','domain'=>'domain','user_id'=>'user_id','category_id'=>'category_id','createtime'=>'createtime','openapi'=>'openapi','cityurl'=>'cityurl','citylist'=>'citylist','fetchrule'=>'fetchrule',),
			'method'=>'post', // define method post/get
			'api'=>'UrlLogic::addUrl', //get the api logic do deal the request
			'ajax'=>'0', // set 1/0 
			//POST data check
			'check'=>array(
				'title'=>array ('1','require','名称不能为空'),
				'tags'=>array ('1','require','标签不能为空'),
				'desc'=>array ('1','require','描述不能为空'),
				'domain'=>array ('1','require','域名不能为空'),
				'openapi'=>array ('1','require','API地址不能为空'),
			),
			'auto'=>array(
				'id'=>'objid',
				'user_id'=>'userid',
				'createtime'=>'time',
			),
			//set the default value of the form
			'value'=>array(
			),
			'next'=>'index/home', //add form to deal
			'return'=>'json', //return json/xml
		),
		
		'product'=>array(
			'object'=>'product',
			'fields'=>array('id'=>'id','title'=>'title','titleextend'=>'titleextend','tags'=>'tags','desc'=>'desc','status'=>'status','createtime'=>'createtime','location'=>'location','image'=>'image','fromurl'=>'fromurl','user_id'=>'user_id','brand_id'=>'brand_id','price'=>'price','newprice'=>'newprice','showtype'=>'showtype','url_id'=>'url_id','imageids'=>'imageids','starttime'=>'starttime','endtime'=>'endtime','locationid'=>'locationid','extension'=>'extension','website'=>'website','cate'=>'cate','rebate'=>'rebate','shops'=>'shops',),
			'method'=>'post',
			'api'=>'ProductLogic::addProduct',
			'ajax'=>'0',
			'return'=>'json',
			'check'=>array(
				'title'=>array ('1','require','名称不能为空'),
				'fromurl'=>array ('1','require','来源不能为空'),
			),
			'next'=>'index/home', //add form to deal
			'value'=>array(
			   ),
			'auto'=>array(
				  'id'=>'objid',
				  'status'=>'getstatus',
				  'createtime'=>'time',
				  'user_id'=>'userid',
				),
			),
					
		'brand'=>array(
			'object'=>'brand',
			'fields'=>array('id'=>'id','title'=>'title','titleextend'=>'titleextend','desc'=>'desc','siteurl'=>'siteurl','status'=>'status','tags'=>'tags','image'=>'image','user_id'=>'user_id',),
			'method'=>'post',
			'api'=>'BrandLogic::addBrand',
			'ajax'=>'0',
			'return'=>'json',
			'check'=>array(
				'title'=>array ('1','require','品牌名称不能为空'),
				'titleextend'=>array ('1','require','英文名称不能为空'),
				'siteurl'=>array ('1','require','网址不能为空'),
				'image'=>array ('1','require','图片ID不能为空'),
			),
			'next'=>'index/home', //add form to deal
			'value'=>array(
			   ),
			 'auto'=>array(
			  'id'=>'objid',
			  'status'=>'getstatus',
			  'user_id'=>'userid',
			),
		),
		
		'image'=>array(
			'object'=>'image',
			'fields'=>array('id'=>'id','filename'=>'filename','desc'=>'desc','createtime'=>'createtime','status'=>'status','remoteurl'=>'remoteurl','url'=>'url','model'=>'model','user_id'=>'user_id',),
			'method'=>'post',
			'api'=>'ImageLogic::addImage',
			'ajax'=>'1',
			'return'=>'json',
			
			'check'=>array(
				'filename'=>array ('1','require','图片名不能为空'),
				'remoteurl'=>array ('1','require','远程地址不能为空'),
				'url'=>array ('1','require','URL不能为空'),
				'model'=>array ('1','require','模块不能为空'),
			),
			
			'value'=>array(
			   ),
			 'auto'=>array(
			  'id'=>'objid',
			  'createtime'=>'time',
			  'status'=>'getstatus',
			  'user_id'=>'userid',
			),
		),
		
		'mail'=>array(
			'object'=>'mail',
			'fields'=>array('id'=>'id','fromuid'=>'fromuid','touid'=>'touid','title'=>'title','content'=>'content','createtime'=>'createtime','replyid'=>'replyid','status'=>'status',),
			'method'=>'post',
			'api'=>'MailLogic::addMail',
			'ajax'=>'0',
			'return'=>'json',
			'next'=>'index/home',
			
			'check'=>array(
				'touid'=>array ('1','require','收信人ID不能为空'),
				'title'=>array ('1','require','标题不能为空'),
				'content'=>array ('1','require','消息内容不能为空'),
			),
			
			'value'=>array(
			   ),
			 'auto'=>array(
			   'id'=>'objid',
			  'fromuid'=>'userid',
			  'createtime'=>'time',
			  'status'=>'getstatus',
			),
		),
		
	'group'=>array(
		'object'=>'group',
		'fields'=>array('id'=>'id','title'=>'title','tags'=>'tags','desc'=>'desc','image_id'=>'image_id','membercount'=>'membercount','topiccount'=>'topiccount','createtime'=>'createtime','enname'=>'enname','status'=>'status','user_id'=>'user_id','adminids'=>'adminids',),
		'method'=>'post',
		'api'=>'GroupLogic::addGroup',
		'ajax'=>'0',
		'return'=>'json',
		'next'=>'index/home',
		
		'check'=>array(
			'title'=>array ('1','require','组名不能为空'),
			'tags'=>array ('1','require','关键字不能为空'),
			'enname'=>array ('1','require','英文名不能为空'),
		),
		
		'value'=>array(
		   ),
		 'auto'=>array(
		  'id'=>'objid',
		  'createtime'=>'time',
		  'status'=>'getstatus',
		  'user_id'=>'userid',
		),
	),
		
	
	'topic'=>array(
		'object'=>'topic',
		'fields'=>array('id'=>'id','title'=>'title','content'=>'content','postcount'=>'postcount','createtime'=>'createtime','lastreplytime'=>'lastreplytime','group_id'=>'group_id','user_id'=>'user_id','status'=>'status','tags'=>'tags','desc'=>'desc','istop'=>'istop','islock'=>'islock',),
		'method'=>'post',
		'api'=>'TopicLogic::addTopic',
		'ajax'=>'0',
		'return'=>'json',
		'next'=>'index/home',
		
		'check'=>array(
			'title'=>array ('1','require','标题不能为空'),
			'tags'=>array ('1','require','标签不能为空'),
			'content'=>array ('1','require','内容不能为空'),
			//'group_id'=>array ('1','require','所属群组不能为空'),
		),
		
		'value'=>array(
		   ),
		 'auto'=>array(
		  'id'=>'objid',
		  'createtime'=>'time',
		  'user_id'=>'userid',
		  'status'=>'getstatus',
		),
	),
			
	
	
	'content'=>array(
		'object'=>'content',
		'fields'=>array('id'=>'id','module'=>'module','action'=>'action','title'=>'title','tags'=>'tags','desc'=>'desc','status'=>'status','content'=>'content','services_id'=>'services_id',),
		'method'=>'post',
		'api'=>'contentLogic::addContent',
		'ajax'=>'0',
		'return'=>'json',
		'next'=>'index/home',
		
		'check'=>array(
			'title'=>array ('1','require','标题不能为空'),
			'tags'=>array ('1','require','关键字不能为空'),
		),
		
		'value'=>array(
			'module'=>'module',
		  	'action'=>'action',
		   ),
		 'auto'=>array(
		  'id'=>'objid',
		  
		  'status'=>'getstatus',
		  'services_id'=>'ServicesID',
		),
	),
	
	'userandmodel'=>array(
		'object'=>'userandmodel',
		'fields'=>array('id'=>'id','linktype'=>'linktype','status'=>'status','createtime'=>'createtime','user_id'=>'user_id','model'=>'model','model_id'=>'model_id','locationid'=>'locationid','updatetime'=>'updatetime','extension'=>'extension',),
		'method'=>'post',
		'api'=>'userandmodelLogic::addUserandmodel',
		'ajax'=>'0',
		'return'=>'json',
		'next'=>'index/home',
		
		'check'=>array(
			'linktype'=>array ('1','require','类型不能为空'),
			'model'=>array ('1','require','模型不能为空'),
			'model_id'=>array ('1','require','模型ID不能为空'),
		),
		
		'value'=>array(
		   ),
		 'auto'=>array(
		  'id'=>'objid',
		  'status'=>'getstatus',
		  'createtime'=>'time',
		  'user_id'=>'userid',
		),
	),
	
	
	'savesetting'=>array(
			'object'=>'account',
			'fields'=>array('id'=>'id','screenname'=>'screenname'),
			'method'=>'post', // define method post/get
			'api'=>'AccountLogic::actSave', //get the api logic do deal the request
			'ajax'=>'0', // set 1/0 
			//POST data check
			'check'=>array(
				//checktype 1=>must_validate,2=>value_validate,3=>exist_validate
				//'account'=>array(1,'require','标题必须填写'),//validate preg check, error report
				'screenname'=>array(2,'require','显示名不能为空'),
			),
			'auto'=>array(
				'id'=>'userid',
			),
			'callback'=>'account',
			'next'=>'account/setting', //add form to deal
			'return'=>'json', //return json/xml
		),
		
	'savepassword'=>array(
			'object'=>'account',
			'fields'=>array('id'=>'id','password'=>'password','newpassword'=>'newpassword'),
			'method'=>'post', // define method post/get
			'api'=>'AccountLogic::actPassword', //get the api logic do deal the request
			'ajax'=>'0', // set 1/0 
			//POST data check
			'check'=>array(
				//checktype 1=>must_validate,2=>value_validate,3=>exist_validate
				'password'=>array(1,'require','密码不能为空'),
				'newpassword'=>array(1,'require','新密码不能为空'),
			),
			'auto'=>array(
				'id'=>'userid',
				'password'=>'md5',
				'newpassword'=>'md5',
			),
			'callback'=>'account',
			'next'=>"account/changepassword?msgcode=10101", //add form to deal
			'return'=>'json', //return json/xml
		),
	
	
	'useraction'=>array(
		'object'=>'modelandmodel',
		'fields'=>array('uid'=>'uid','id'=>'id','type'=>'atype'),
		'method'=>'post',
		'api'=>'RelationService::setUserRelation',
		'ajax'=>'1',
		'return'=>'json',
		'next'=>'',
		
		'check'=>array(
			//'type'=>array ('1','require','类型不能为空'),
			//'id'=>array ('1','require','ID不能为空'),
		),
		
		'value'=>array(
		 
		),
		'auto'=>array(
		  'uid'=>'userid',
		),
	),
	

	),
	

			
);